<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('整改记录新增')" />
	<th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-redBlack-add">
			<div class="form-group">
				<label class="col-sm-3 control-label ">被检查单位：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="enterpriseName" id="enterpriseName" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">检查单位：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="inspectUnit" id="inspectUnit" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">检查记录单号：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="tikcetNo" id="tikcetNo" required>
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-3 control-label">问题描述：</label>
                <div class="col-xs-8">
                       <textarea id="remark" name="remark" maxlength="500" class="form-control" rows="2"></textarea>
                </div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-3 control-label">问题发现日期：</label>
				<div class="col-sm-4">
                  <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                      <input type="text" class="form-control" name="checkTime" id="checkTime" required>
                   </div>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 时间格式，如2020-12-02</span>
			     </div>
			 </div>
			
			<div class="form-group">
				<label class="col-sm-3 control-label">整改情况：</label>
                <div class="col-xs-8">
                       <textarea id="result" name="result" maxlength="500" class="form-control" rows="2"></textarea>
                </div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-3 control-label">整改完成日期：</label>
				<div class="col-sm-4">
                  <div class="input-group date"> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                      <input type="text" class="form-control" name="finishTime" id="finishTime" required>
                   </div>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 时间格式，如2020-12-02</span>
			     </div>
			 </div>
			
			<div class="form-group">
				<label class="col-sm-3 control-label">是否下发：</label>
				<div class="col-sm-4">
                  <label class="radio-box">
                     
                        <input type="radio" checked="" value="1" id="status" name="hasPub" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
                                                             下发</label>
                  <label class="radio-box">
                        <input type="radio" value="0" id="status" name="hasPub" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
                                                            不下发</label>
                 </div>
			</div>
			
			
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: ztree-js" />
	<script type="text/javascript">
	  	
		$("#form-redBlack-add").validate();
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	add();
	        }
	    }
	
		function add() {
			var enterpriseName = $("input[name='enterpriseName']").val();
			var inspectUnit = $("input[name='inspectUnit']").val();
			var tikcetNo = $("input[name='tikcetNo']").val();
			var hasPub = $("input[name='hasPub']:checked").val();
			var remark = $("textarea[name='remark']").val();
			var checkTime = $("input[name='checkTime']").val();
			var result = $("textarea[name='result']").val();
			var finishTime = $("input[name='finishTime']").val();
			$.ajax({
				cache : true,
				type : "POST",
				url : ctx + "rectInfo/add",
				data : {
					"enterpriseName": enterpriseName,
					"inspectUnit": inspectUnit,
					"tikcetNo": tikcetNo,
					"hasPub": hasPub,
					"remark": remark,
					"checkTime": checkTime,
					"result": result,
					"finishTime": finishTime
				},
				async : false,
				error : function(request) {
					$.modal.alertError("系统错误");
				},
				success : function(data) {
					$.operate.successCallback(data);
				}
			});
		}
	</script>
</body>
</html>
